// 路由配置信息
//引入路由组件
import Home from '@/pages/Home'
import Search from '@/pages/Search'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import Detail from '@/pages/Detail'
import AddCartSuccess from '@/pages/AddCartSuccess'
import ShopCart from '@/pages/ShopCart'
import Trade from '@/pages/Trade'
import Pay from "@/pages/Pay";
import PaySuccess from "@/pages/PaySuccess";
import Center from "@/pages/Center";
export default[
    // Home
    {
        path:"/Home",
        component:Home,
        meta:{
            show:true
        }
    },
    // Search
    {
        path:"/Search/:keyword?",
        component:Search,
        name:"search",
        meta:{
            show:true
        },
        props:($route)=>{
            return {
                keyword:$route.params.keyword
            }
        }
    },
    // Login
    {
        path:"/Login",
        component:Login,
        meta:{
            show:false
        }
    },
    // Register
    {
        path:"/Register",
        component:Register,
        meta:{
            show:false
        }
    },
    // Detail
    {
        path:"/Detail/:id?",
        component:Detail,
        meta:{
            show:false
        }
    },
    // AddCartSuccess
    {
        path:"/AddCartSuccess",
        component:AddCartSuccess,
        name:'AddCartSuccess',
        meta:{
            show:false
        }
    },
    // ShopCart
    {
        path:"/ShopCart",
        component:ShopCart,
        name:'ShopCart',
        meta:{
            show:false
        }
    },
    // trade
    {
        path:"/Trade",
        component:Trade,
        name:'Trade',
        meta:{
            show:true
        }
    },
    // pay
    {
        path:"/Pay",
        component:Pay,
        name:'Pay',
        meta:{
            show:true
        }
    },
    // PaySuccess
    {
        path:"/PaySuccess",
        component:PaySuccess,
        name:'PaySuccess',
        meta:{
            show:true
        }
    },
    // Center
    {
        path:"/Center",
        component:Center,
        name:'Center',
        meta:{
            show:true
        }
    },
    //重定向
    {
        path:"*",
        redirect:'/Home'
    }
]